import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '评审专家',
    align:"center",
    dataIndex: 'createBy'
   },
   {
    title: '评审时间',
    align:"center",
    dataIndex: 'createTime'
   },
   {
    title: '评审记录id',
    align:"center",
    dataIndex: 'pingsjlId'
   },
   {
    title: '作品id',
    align:"center",
    dataIndex: 'zuopId'
   },
   {
    title: '评分项id',
    align:"center",
    dataIndex: 'pingfxId_dictText'
   },
   {
    title: '分值',
    align:"center",
    dataIndex: 'fenz'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '评审记录id',
    field: 'pingsjlId',
    component: 'Input',
  },
  {
    label: '作品id',
    field: 'zuopId',
    component: 'Input',
  },
  {
    label: '评分项id',
    field: 'pingfxId',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"cdba_pingsgz,biaot,id"
     },
  },
  {
    label: '分值',
    field: 'fenz',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  createBy: {title: '评审专家',order: 0,view: 'text', type: 'string',},
  createTime: {title: '评审时间',order: 1,view: 'datetime', type: 'string',},
  pingsjlId: {title: '评审记录id',order: 2,view: 'text', type: 'string',},
  zuopId: {title: '作品id',order: 3,view: 'text', type: 'string',},
  pingfxId: {title: '评分项id',order: 4,view: 'list', type: 'string',dictTable: "cdba_pingsgz", dictCode: 'id', dictText: 'biaot',},
  fenz: {title: '分值',order: 5,view: 'text', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}